package com.whros.android.sample.util;

import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;

/**
 * Created by whroi on 2017/6/11.
 */

public class BitmapUtils {


    public static String formatMemorySize(int sizeB){

        int kB = sizeB/1024;
        if(kB<1024){
            int leftB = (int)(sizeB%1024/102.4f);
            return kB+"."+leftB+"KB";
        }
        int mB = kB/1024;
        if(mB<1024){
            int leftKB = (int)(kB%1024*1.0f/102.4f);
            return mB+"."+leftKB+"MB";
        }
       return mB+"MB";

    }
}
